package org.vnl.platform.orm;

import java.text.DecimalFormat;

import org.vnl.platform.dk.util.SEVERITY;

/**
 * ORM 設定錯誤碼
 * 
 * @author Vaughan
 *
 */
public enum ORMEnvCode {

    /**
     * 使用不當的實作  params -> 0: Reason
     */
    ERR_INCORRECT_IMPLEMENTATION(SEVERITY.ERROR),
    /**
     * Transaction id missing params-> 0: transaction id 
     */
    ERR_TRANSACTION_ID_NOT_SUPPORT(SEVERITY.ERROR);
    
    SEVERITY severity;
    
    ORMEnvCode(SEVERITY severity) {
        this.severity = severity;
    }
    
    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("ORM_SE_"); // ORM_SYSTEM_ENVIORNMENT
        DecimalFormat df = new DecimalFormat("0000");
        sb.append(df.format(this.ordinal()));
        return sb.toString();
    }
    
    public String getSeverityString() {
        return this.severity.toString();
    }
    
    public SEVERITY getSeverity() {
        return this.severity;
    }

}
